import Account.*;
import Operation.*;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        AcountList acountList = new AcountList();
        //先登录再进行操作
        Scanner scanner = new Scanner(System.in);
        IOperation i = new QueryOperation();
        while (true) {
            System.out.println("登陆账号》1");
            System.out.println("开通账户》5");
            int choice  = scanner.nextInt();
            if (choice == 5) {
                i.doOperation(5).work(null,acountList);
            } else if(choice==1){
                Account account = i.login(acountList.getMap());
                while (account != null) {
                    choice = i.menu();
                    if (choice >0&&choice<=4)
                        i.doOperation(choice).work(account,acountList);
                    else if(choice==0){
                        System.out.println("退出成功");
                        account = null;
                    }
                }
            }else{
                System.out.println("输入错误");
            }

        }
    }
}
